home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Hello / hello.jar / Hello.class (.txt) next >
Encoding:
Java Class File  |  2001-07-17  |  1.6 KB  |  41 lines

  1. import javax.microedition.lcdui.Command;
  2. import javax.microedition.lcdui.CommandListener;
  3. import javax.microedition.lcdui.Display;
  4. import javax.microedition.lcdui.Displayable;
  5. import javax.microedition.midlet.MIDlet;
  6.  
  7. public class Hello extends MIDlet implements CommandListener {
  8.    static final String EXIT_COMMAND_LABEL = "Exit hello world";
  9.    static final String AGAIN_COMMAND_LABEL = "Again, again ...";
  10.    Display display;
  11.    static Hello hello;
  12.  
  13.    protected void destroyApp(boolean var1) {
  14.       this.display.setCurrent((Displayable)null);
  15.       ((MIDlet)this).notifyDestroyed();
  16.    }
  17.  
  18.    protected void pauseApp() {
  19.    }
  20.  
  21.    protected void startApp() {
  22.       HelloCanvas var1 = new HelloCanvas();
  23.       this.display = Display.getDisplay(this);
  24.       Command var2 = new Command("Exit hello world", 1, 0);
  25.       Command var3 = new Command("Again, again ...", 1, 1);
  26.       ((Displayable)var1).addCommand(var2);
  27.       ((Displayable)var1).addCommand(var3);
  28.       ((Displayable)var1).setCommandListener(this);
  29.       this.display.setCurrent(var1);
  30.    }
  31.  
  32.    public void commandAction(Command var1, Displayable var2) {
  33.       String var3 = var1.getLabel();
  34.       if (var3 == "Exit hello world") {
  35.          this.destroyApp(false);
  36.       } else if (var3 == "Again, again ...") {
  37.       }
  38.  
  39.    }
  40. }
  41.